//
//  TJToast.swift
//  maosheng
//
//  Created by 何海涛 on 2019/8/12.
//

import Foundation

class TJToast {
    static func showMessage(_ message: String, duration: TimeInterval) {
        if let window = UIApplication.shared.keyWindow {
            let old = ToastManager.shared.duration
            do {
                ToastManager.shared.duration = duration
                let view = try window.toastViewForMessage(message, title: nil, image: nil, style: ToastManager.shared.style)
                window.showToast(view)
            }catch{ }
            ToastManager.shared.duration = old
        }
        
    }
}
